<?php
namespace app\admin\controller;
use think\Session;
use app\common\controller\Backend;
use app\common\model\BackendMenuModel;

class Index extends Backend
{
  public function index()
  {
    $backendUser = Session::get("backendUser");
    //获取用户菜单
    $BackendMenuModel = new BackendMenuModel();
    $menu = $BackendMenuModel->getUserGroupMenu($backendUser['user_group_id']);

    return view('index',['menu'=>$menu,'username'=>$this->backendUser['username']]);
  }

  public function content(){
    $system_version = $_SERVER["SERVER_SOFTWARE"];      //获取服务器标识的字串
    $php_version = PHP_VERSION;                   //获取PHP服务器版本
    //从PHP配置文件中获得最大上传限制
    $max_upload = ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled";
    //从PHP配置文件中获得脚本的最大执行时间
    $max_ex_time= ini_get("max_execution_time")."秒";
    //以下两条获取服务器时间，中国大陆采用的是东八区的时间,设置时区写成Etc/GMT-8
    date_default_timezone_set("Etc/GMT-8");
    $systemtime = date("Y-m-d H:i:s",time());

    // var_dump( $system_version );die();
    return view('content',[
        'system_version' => $system_version,
        'php_version' => $php_version,
        'max_upload' => $max_upload,
        'max_ex_time' => $max_ex_time,
        'systemtime' => $systemtime,
    ]);
  }

}
